/*
此代码可以将清华点云的frame_id进行修改并重新转发
*/
#include "ros/ros.h"
#include "sensor_msgs/PointCloud2.h"
 
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
 
#include <octomap/octomap.h>
#include <octomap/Pointcloud.h>
#include <octomap/ColorOcTree.h>
#include <octomap_msgs/Octomap.h>
 
#include "myoctomap/pcl_conversions.h"

#include "/home/hkb/ros_source/octomap_msgs/include/octomap_msgs/conversions.h"

sensor_msgs::PointCloud2 data;
void cb_point(sensor_msgs::PointCloud2::ConstPtr msg)
{
    data = *msg;
    data.header.frame_id = "map";
    ROS_INFO("接收到点云数据，进行转换\n");
}

int main(int argc, char *argv[])
{
    setlocale(LC_ALL,"");
    ros::init(argc,argv,"point_tf");
    ros::NodeHandle nh;
    ros::Publisher point_pub;
    ros::Subscriber point_sub;
    point_pub = nh.advertise<sensor_msgs::PointCloud2>("/pointcloud_output",10);
    point_sub = nh.subscribe<sensor_msgs::PointCloud2>("/robot1/pandar",10,cb_point);
    ros::Rate loop_rate(50);
    while(ros::ok())
    {
        point_pub.publish(data);
        ros::spinOnce();
        loop_rate.sleep();
    }
    return 0;
}
